Repository navigation
Conversation
1. Latch X11 layer surfaces to their selected output. 2. Rebind Dock and notification center when screens change. 3. Select a valid remaining output when a screen is removed. Log: Keep layer-shell windows on the intended display. PMS: TASK-384487, TASK-384649 fix: 保持 layer surface 的屏幕绑定 1. 锁存 X11 layer surface 创建时指定的屏幕。 2. Dock 和通知中心换屏时显式更新屏幕绑定。 3. 屏幕移除后选择仍有效的显示器。 Log: 修复多屏布局调整后窗口错屏及 Dock 迁屏问题。 PMS: TASK-384487, TASK-384649 (cherry picked from commit 7c03f9c)
1. Restrict output latching to background surfaces to preserve desktop placement when rearranging extended screens. 2. Restore QWindow::screen() tracking for other layers to fix dock freezes and incorrect screen selection outlines. 3. Update the latched output before switching the window screen and remove redundant notification center rebinding. Influence: 1. Rearrange extended screens and verify both desktop backgrounds. 2. Switch primary screens with the dock following the primary screen or mouse. 3. Select HDMI and eDP in display settings and verify the matching outlines. 4. Verify notification center, notification bubbles and OSD after switching. fix: 修复多屏切换卡死及屏幕选中描边错位 1. 将输出锁存限定为背景层,保留扩展屏重排时的桌面背景归属。 2. 其他层恢复跟随 QWindow::screen(),修复任务栏卡死及选屏描边错屏, 无需修改控制中心等现有调用方。 3. 切换窗口屏幕前同步锁存输出,移除通知中心多余的屏幕重绑调用。 Influence: 1. 扩展模式下调整屏幕排列,确认主副屏背景正常显示。 2. 分别设置任务栏跟随主屏、跟随鼠标,切换主屏后确认无卡死。 3. 点击显示设置中的 HDMI、eDP 缩略图,确认描边对应正确屏幕。 4. 切屏后确认通知中心、通知气泡及 OSD 的位置和交互正常。 Log: 修复多屏切换导致任务栏卡死及屏幕选中描边错位,保留副屏背景重排修复。 PMS: TASK-384487, TASK-384649 (cherry picked from commit 43d6353)
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: xujin177 The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
Reviewer's GuideAPIExpose screen binding and change notification on DLayerShellWindow so callers can explicitly select an output.
Uses of the APIRoute Dock screen changes through the layer-shell screen-binding API.
ImplementationImplement explicit screen binding and X11 output selection, including background-output latching and fallback when a screen is removed.
UIKeep the notification center following the Dock's screen while relying on the framework's dynamic screen tracking for non-background windows.
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey - I've found 3 issues
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location path="frame/layershell/x11dlayershellemulation.cpp" line_range="79" />
<code_context>
: QObject(parent)
, m_window(window)
, m_dlayerShellWindow(DLayerShellWindow::get(m_window))
+ , m_screen(m_dlayerShellWindow->screen())
{
+ // 背景窗口锁存创建时的 output,避免屏幕重排时随几何漂移。
</code_context>
<issue_to_address>
**Background windows stay on the wrong output**
When a background window's screen is changed explicitly, or a non-background window changes screens before becoming a background layer, `targetScreen()` keeps using the screen captured when the emulation was constructed because `m_screen` is not refreshed on screen or layer changes, so the background window is positioned on the previous output.
Refresh `m_screen` when the window's screen changes and when it becomes a background layer.
Also at `frame/layershell/x11dlayershellemulation.cpp:212-213`.
</issue_to_address>
### Comment 2
<location path="frame/layershell/dlayershellwindow.cpp" line_range="179" />
<code_context>
}
QWindow* parentWindow;
</code_context>
<issue_to_address>
**Compositor-selected output ignores rebinding**
When a caller uses `setScreen()` while the layer is configured with `ScreenFromCompositor`, `setScreen()` changes only `QWindow::screen()`, but a layer configured with `ScreenFromCompositor` creates its Wayland surface with a null output and does not listen for window screen changes. Calling the new binding API in that configuration therefore leaves the layer surface compositor-selected instead of bound to the requested screen.
Make explicit `setScreen()` switch the layer to `ScreenFromQWindow`, or reject/document rebinding as unsupported in compositor-selected mode.
</issue_to_address>
### Comment 3
<location path="frame/layershell/dlayershellwindow.cpp" line_range="184-186" />
<code_context>
+
+QScreen *DLayerShellWindow::screen() const
+{
+ if (d->screen) {
+ return d->screen.data();
+ }
+ return d->parentWindow ? d->parentWindow->screen() : nullptr;
+}
</code_context>
<issue_to_address>
**Screen getter reports the old output**
When a non-background layer has been explicitly bound and its `QWindow::screen()` changes independently, `DLayerShellWindow::screen()` returns the stored `d->screen` instead of the window's current screen, so callers see the old output and the background emulator can latch that stale screen.
Use the current window screen for non-background layers and retain the stored screen only for background layers.
Also at `frame/layershell/dlayershellwindow.cpp:170`.
</issue_to_address>| : QObject(parent) | ||
| , m_window(window) | ||
| , m_dlayerShellWindow(DLayerShellWindow::get(m_window)) | ||
| , m_screen(m_dlayerShellWindow->screen()) |
There was a problem hiding this comment.
🟡 Medium · Background windows stay on the wrong output
When a background window's screen is changed explicitly, or a non-background window changes screens before becoming a background layer, targetScreen() keeps using the screen captured when the emulation was constructed because m_screen is not refreshed on screen or layer changes, so the background window is positioned on the previous output.
Refresh m_screen when the window's screen changes and when it becomes a background layer.
Also at frame/layershell/x11dlayershellemulation.cpp:212-213.
Prompt for AI agents
In `frame/layershell/x11dlayershellemulation.cpp` at line 79:
**Background windows stay on the wrong output**
When a background window's screen is changed explicitly, or a non-background window changes screens before becoming a background layer, `targetScreen()` keeps using the screen captured when the emulation was constructed because `m_screen` is not refreshed on screen or layer changes, so the background window is positioned on the previous output.
Refresh `m_screen` when the window's screen changes and when it becomes a background layer.
Also at `frame/layershell/x11dlayershellemulation.cpp:212-213`.| // X11 背景层读取锁存输出,其他层继续跟随 QWindow::screen()。 | ||
| if (d->parentWindow && screen && d->parentWindow->screen() != screen) { | ||
| d->parentWindow->setScreen(screen); | ||
| } |
There was a problem hiding this comment.
🟡 Medium · Compositor-selected output ignores rebinding
When a caller uses setScreen() while the layer is configured with ScreenFromCompositor, setScreen() changes only QWindow::screen(), but a layer configured with ScreenFromCompositor creates its Wayland surface with a null output and does not listen for window screen changes. Calling the new binding API in that configuration therefore leaves the layer surface compositor-selected instead of bound to the requested screen.
Make explicit setScreen() switch the layer to ScreenFromQWindow, or reject/document rebinding as unsupported in compositor-selected mode.
Prompt for AI agents
In `frame/layershell/dlayershellwindow.cpp` at line 179:
**Compositor-selected output ignores rebinding**
When a caller uses `setScreen()` while the layer is configured with `ScreenFromCompositor`, `setScreen()` changes only `QWindow::screen()`, but a layer configured with `ScreenFromCompositor` creates its Wayland surface with a null output and does not listen for window screen changes. Calling the new binding API in that configuration therefore leaves the layer surface compositor-selected instead of bound to the requested screen.
Make explicit `setScreen()` switch the layer to `ScreenFromQWindow`, or reject/document rebinding as unsupported in compositor-selected mode.| if (d->screen) { | ||
| return d->screen.data(); | ||
| } |
There was a problem hiding this comment.
🟡 Medium · Screen getter reports the old output
When a non-background layer has been explicitly bound and its QWindow::screen() changes independently, DLayerShellWindow::screen() returns the stored d->screen instead of the window's current screen, so callers see the old output and the background emulator can latch that stale screen.
Use the current window screen for non-background layers and retain the stored screen only for background layers.
Also at frame/layershell/dlayershellwindow.cpp:170.
Prompt for AI agents
In `frame/layershell/dlayershellwindow.cpp` at lines 184-186:
**Screen getter reports the old output**
When a non-background layer has been explicitly bound and its `QWindow::screen()` changes independently, `DLayerShellWindow::screen()` returns the stored `d->screen` instead of the window's current screen, so callers see the old output and the background emulator can latch that stale screen.
Use the current window screen for non-background layers and retain the stored screen only for background layers.
Also at `frame/layershell/dlayershellwindow.cpp:170`.
|
Summary by Sourcery
Keep background layer surfaces bound to their selected output while preserving dynamic screen selection for other layers.
New Features:
Bug Fixes:
Enhancements: